home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / MPW / flex 2.4.6 / Makefile < prev    next >
Encoding:
Makefile  |  1994-02-12  |  3.9 KB  |  154 lines  |  [TEXT/MPS ]

  1. # Makefile for MPW Flex
  2. # Franklin Chen
  3. # Fri, Jan 21, 1994    Version 2.4.6
  4.  
  5. # @(#) $Header: Makefile.in,v 1.2 94/01/04 14:33:19 vern Exp $ (LBL)
  6.  
  7. # If your version of "make" does not define $(MAKE), comment in the
  8. # definition of "MAKE" below.  (You only need to do this if you intend
  9. # to do "make bigcheck" or "make dist".)
  10. MAKE = BuildProgram
  11.  
  12. # Possible values for DEFS:
  13. #
  14. # For flex to always generate 8-bit scanners, add "-DDEFAULT_CSIZE=256"
  15. # to DEFS.
  16. #
  17. # For Vax/VMS, add "-DVMS" to DEFS.
  18. #
  19. # For MS-DOS, add "-DMS_DOS" to DEFS.  See the directory :MISC:MSDOS for
  20. # additional info.
  21.  
  22. COptions = ∂
  23.     -mc68020 ∂
  24. #    -mc68881 ∂
  25. #    -elems881 ∂
  26.     -warnings full ∂
  27.     -opt full ∂
  28. #    -finline-functions ∂
  29. #    -fomit-frame-pointer ∂
  30. #    -fstrength-reduce ∂
  31.     -model far
  32. DEFS = ∂
  33.     -d MPW ∂
  34.     -d __STDC__    # for MPW C ∂
  35.     -d HAVE_ALLOCA_H    # for MPW C ∂
  36.     -d HAVE_STRING_H ∂
  37.     -d DEFAULT_CSIZE=256
  38. LOptions = -d -c 'MPS ' -t MPST ∂
  39.     -model far
  40. LIBS = ∂
  41.     "{CLibraries}"StdClib.o ∂
  42.     "{Libraries}"Stubs.o ∂
  43.     "{Libraries}"Runtime.o ∂
  44.     "{Libraries}"Interface.o ∂
  45.     "{Libraries}"ToolLibs.o
  46.  
  47. srcdir = :
  48.  
  49. YACC = Bison -y
  50. #YACC = byacc
  51. #C = gC
  52. C = C
  53.  
  54. # You normally do not need to modify anything below this point.
  55. # ------------------------------------------------------------
  56.  
  57. CPPFLAGS = -i : -i {srcdir} {DEFS}
  58.  
  59. .c.o ƒ .c
  60.     {C} {CPPFLAGS} {COptions} -s {default} {depDir}{default}.c -o {targDir}{default}.c.o 
  61.  
  62. HEADERS = flexdef.h version.h
  63.  
  64. SOURCES = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y ∂
  65.     scan.l skel.c sym.c tblcmp.c yylex.c
  66. OBJECTS = ccl.c.o dfa.c.o ecs.c.o gen.c.o main.c.o misc.c.o nfa.c.o parse.c.o ∂
  67.     scan.c.o skel.c.o sym.c.o tblcmp.c.o yylex.c.o
  68.  
  69. LIBSRCS = libmain.c libyywrap.c
  70. LIBOBJS = libmain.c.o libyywrap.c.o
  71.  
  72. # which "Flex" to use to generate scan.c from scan.l
  73. FLEX = :Flex
  74. FLEX_FLAGS = -ist {PERF_REPORT}
  75. COMPRESSION =
  76. PERF_REPORT = -p
  77.  
  78. FLEXLIB = FlexLib.o
  79.  
  80.  
  81. all ƒ Flex
  82.  
  83. Flex ƒƒ _bootstrap {OBJECTS} {FLEXLIB}
  84.     Link -o Flex {LOptions} {OBJECTS} {FLEXLIB} {LIBS} ∂
  85.         -sg Main=ccl,dfa,ecs,gen,main,misc,nfa ∂
  86.         -sg Parse=parse,scan,sym,tblcmp,yylex
  87. Flex ƒƒ Flex.r
  88.     Rez Flex.r -a -o Flex
  89.  
  90. _bootstrap ƒ initscan.c
  91.     Delete -i scan.c
  92.     Duplicate -y {srcdir}initscan.c scan.c
  93.     Echo "" > _bootstrap
  94.  
  95. parse.c ƒ parse.y
  96.     {YACC} -d {srcdir}parse.y
  97.     sed '/extern char.*malloc/d' <y.tab.c >parse.c
  98.     Delete -i y.tab.c
  99.     Move -y y.tab.h parse.h
  100.  
  101. parse.h ƒ parse.c
  102.  
  103. scan.c ƒ scan.l
  104.     {FLEX} {FLEX_FLAGS} {COMPRESSION} {srcdir}scan.l >scan.tmp
  105.     sed "s,∂"{srcdir}scan.l∂",∂"scan.l∂"," <scan.tmp >scan.c
  106.     Delete -i scan.tmp
  107.  
  108. scan.c.o ƒ scan.c parse.h flexdef.h
  109. yylex.c.o ƒ yylex.c parse.h flexdef.h
  110.  
  111. skel.c ƒ flex.skl mkskel.sh
  112.     {srcdir}mkskel.sh {srcdir}flex.skl >skel.c
  113.  
  114. main.c.o ƒ main.c flexdef.h version.h
  115. ccl.c.o ƒ ccl.c flexdef.h
  116. dfa.c.o ƒ dfa.c flexdef.h
  117. ecs.c.o ƒ ecs.c flexdef.h
  118. gen.c.o ƒ gen.c flexdef.h
  119. misc.c.o ƒ misc.c flexdef.h
  120. nfa.c.o ƒ nfa.c flexdef.h
  121. parse.c.o ƒ parse.c flexdef.h
  122. skel.c.o ƒ skel.c flexdef.h
  123. sym.c.o ƒ sym.c flexdef.h
  124. tblcmp.c.o ƒ tblcmp.c flexdef.h
  125.  
  126. test ƒ check
  127. check ƒ Flex
  128.     :Flex {FLEX_FLAGS} {COMPRESSION} {srcdir}scan.l ∂
  129.     | sed "s,∂"{srcdir}scan.l∂",∂"scan.l∂"," ∂
  130.     | diff scan.c -
  131.     Echo "Check successful, using COMPRESSION={COMPRESSION}"
  132.  
  133. bigcheck ƒ
  134.     Delete -i scan.c ; {MAKE} -d COMPRESSION="-C" check
  135.     Delete -i scan.c ; {MAKE} -d COMPRESSION="-Ce" check
  136.     Delete -i scan.c ; {MAKE} -d COMPRESSION="-Cm" check
  137.     Delete -i scan.c ; {MAKE} -d COMPRESSION="-Cfea" check
  138.     Delete -i scan.c ; {MAKE} -d COMPRESSION="-CFer" check
  139.     Delete -i scan.c ; {MAKE} -d COMPRESSION="-l" -d PERF_REPORT="" check
  140.     Delete -i scan.c ; {MAKE}
  141.     Echo "All checks successful"
  142.  
  143. {FLEXLIB} ƒ {LIBOBJS}
  144.     Lib -o {FLEXLIB} {LIBOBJS} ∂
  145.         -sg Main=libmain,libyywrap
  146.  
  147. install ƒ Flex {FLEXLIB} install_already_built
  148. install_already_built ƒ
  149.     Duplicate Flex "{MPW}"Tools:Flex
  150.     Duplicate UserStartup•Flex "{MPW}"UserStartup•Flex
  151.     Duplicate Flex.Help "{MPW}"Flex.Help
  152.     Duplicate {FLEXLIB} "{CLibraries}"FlexLib.o
  153.     Duplicate {srcdir}FlexLexer.h "{CIncludes}"FlexLexer.h
  154.